#include <REGX52.H>
#include "Delay.h"
#include "Key.h"

void Delay881us()		//@11.0592MHz
{
	unsigned char i, j;

	_nop_();
	i = 2;
	j = 144;
	do
	{
		while (--j);
	} while (--i);
}
sbit BUZZ =P2^5;

unsigned char key_num;
unsigned char time_buzz;
int main()
{
	while(1)
	{
		key_num=KeySelect();
		if(key_num!=0)
		{
			for(time_buzz=0;time_buzz<20;time_buzz++)//响200毫秒
			{
				BUZZ=!BUZZ;
				Delay(10);//延时10毫秒，周期为20毫秒，频率为1/20hz
			}
			if(key_num==1)
			{
				P2_0=!P2_0;
			}
		}
	}

	return 0;
}